<%@page import="javafx.scene.control.Alert"%>
<%@page import="henu.javaweb.dao.*"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@page import="java.util.ArrayList" %>
<%@page import="henu.javaweb.util.WebDbPool"%>
<%@page import="java.sql.*"%>
<%@page import="henu.javaweb.bean.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>学生信息管理系统</title>
<link rel="stylesheet" href="../../css/bootstrap.min.css">
<link rel="stylesheet" href="../../css/my.css">
<script type="text/javascript" src="../../js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="../../js/bootstrap.min.js"></script>
<script>
	if (window.name != "bencalie") {
		location.reload();
		window.name = "bencalie";
	} else {
		window.name = "";
	}
</script>

</head>
<body>
	<%@include file="header.jsp"%>

	<div class="container">
		<form class="form-inline well" method="post"
			action="../../AddStudentServlet" role="form">
			<h4>教师管理</h4>
			<div class="form-group">
				<input type="text" name="sno" placeholder="学号*" class="form-control">
			</div>
			<div class="form-group">
				<input type="text" name="sname" placeholder="姓名*"
					class="form-control">
			</div>
			<div class="form-group">
				<input type="password" name="spass" value="666666"
					class="form-control">
			</div>
			<!--对应的学院，不可更改  -->
			<div class="form-group">
				<input type="text" name="scollege" placeholder="学院" value=""
					class="form-control" disabled="disabled">
			</div>
			<!--对应的专业，不可更改  -->
			<div class="form-group">
				<input type="text" name="smajor" placeholder="专业" value=""
					class="form-control" disabled="disabled">
			</div>
			<input type="submit" name="action"
				class="form-control btn btn-primary" value="添加" />
		</form>
		<table class="table table-striped table-bordered">
			<thread>
			<th>学号</th>
			<th>姓名</th>
			<th>院系</th>
			<th>专业</th>
			<th>操作</th>
			</thread>
			<tbody>
<%
StudentDao sd=new StudentDao();
ArrayList<Student> students=new ArrayList<>();
students=sd.getAllStudent();
for(int i=0;i<students.size();i++){
%>
				<tr>
					<td><%=students.get(i).getS_no() %></td>
					<td><%=students.get(i).getS_name() %></td>
					<td><%=students.get(i).getS_faculty() %></td>
					<td><%=students.get(i).getS_major() %></td>
					<td><a href="alterStudent.jsp?id=<%=students.get(i).getS_no() %>"> <span
							class="glyphicon glyphicon-edit"></span>
					</a>&nbsp;&nbsp; <a href="../../ResetPasswordServlet?id=<%=students.get(i).getS_no() %>"/> <span
						class="glyphicon glyphicon-refresh"></span></a>&nbsp;&nbsp; <a
						href="../../DeleteStudentServlet?id=<%=students.get(i).getS_no() %>"/> <span
						class="glyphicon glyphicon-trash"></span></a></td>
				</tr>
				<%} %>
			</tbody>
		</table>
	</div>
</body>
</html>